home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / umddvi / lib / magfactor.c < prev    next >
Text File  |  1990-10-01  |  869b  |  40 lines

  1. /*
  2.  * Copyright (c) 1987 University of Maryland Department of Computer Science.
  3.  * All rights reserved.  Permission to copy for any purpose is hereby granted
  4.  * so long as this copyright notice remains intact.
  5.  */
  6.  
  7. /*
  8.  * Convert a magnification factor to floating point.  This is used in
  9.  * conjunction with the FONT_SLOP stuff to try to get the file names
  10.  * right, and may also be used by DVI reading programs to get slightly
  11.  * more accurate values for (mag/1000.0).
  12.  */
  13. double
  14. DMagFactor(mag)
  15.     int mag;
  16. {
  17.  
  18.     switch (mag) {
  19.  
  20.     case 1095:        /* stephalf */
  21.         return (1.095445);
  22.  
  23.     case 1315:        /* stepihalf */
  24.         return (1.314534);
  25.  
  26.     case 2074:        /* stepiv */
  27.         return (2.0736);
  28.  
  29.     case 2488:        /* stepv */
  30.         return (2.48832);
  31.  
  32.     case 2986:        /* stepiv */
  33.         return (2.985984);
  34.  
  35.     default:        /* remaining mags have been ok */
  36.         return ((double) mag / 1000.);
  37.     }
  38.     /* NOTREACHED */
  39. }
  40.